package br.org.etec.dotcao.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@NamedQueries({@NamedQuery(name="selectBySpecie", query="select r from Race r where r.species.code = :specie"),
	           @NamedQuery(name="selectByName", query="select r from Race r where r.nome = :name")})
@Table(name="trace")
@Entity
public class Race extends AbstractEntity {

	private static final long serialVersionUID = 1L;

	@Column
	private String nome;

	@Column
	private String size;

	@ManyToOne
	@JoinColumn(name="species")
	private Species species;

	public Race(String nome, String size) {
		super();
		this.nome = nome;
		this.size = size;
	}

	public Race() {
		super();
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public Species getSpecies() {
		return species;
	}

	public void setSpecies(Species species) {
		this.species = species;
	}

}
